global soal1 soal2
global numsoal
global x0 xn h n y01 y02 numy0
global fungsi1 fungsi2
global numfungsi
global metodestring
global hasil1 hasil2 
global numhasil

% epsilon = [0.01 0.1 1 10];
x = [0 10];
h = 0.1;
y0 = [ 1 0 ];
y_absen = @(x,y,z)(0); % ini masih gak ngerti y absen-nya
z_absen1 = @(x,y,z)((0.01*x^2)-x); % epsilon 0.01
z_absen2 = @(x,y,z)((0.1*x^2)-x); % epsilon 0.1
z_absen3 = @(x,y,z)((1*x^2)-x); % epsilon 1
z_absen4 = @(x,y,z)((10*x^2)-x); % epsilon 10
orde = [ 3 4 ];

% Orde 3, epsilon = 0.01
[n result1] = Runge_Kutta( x, h, y0, y_absen, orde(1));
[n result2] = Runge_Kutta( x, h, y0, z_absen1, orde(1));
% Orde 3, epsilon = 0.1
[n result3] = Runge_Kutta( x, h, y0, y_absen, orde(1));
[n result4] = Runge_Kutta( x, h, y0, z_absen2, orde(1));
% Orde 3, epsilon = 1
[n result5] = Runge_Kutta( x, h, y0, y_absen, orde(1));
[n result6] = Runge_Kutta( x, h, y0, z_absen3, orde(1));
% Orde 3, epsilon = 10
[n result7] = Runge_Kutta( x, h, y0, y_absen, orde(1));
[n result8] = Runge_Kutta( x, h, y0, z_absen4, orde(1));

% Orde 4, epsilon = 0.01
[n result9] = Runge_Kutta( x, h, y0, y_absen, orde(2));
[n result10] = Runge_Kutta( x, h, y0, z_absen1, orde(2));
% Orde 4, epsilon = 0.1
[n result11] = Runge_Kutta( x, h, y0, y_absen, orde(2));
[n result12] = Runge_Kutta( x, h, y0, z_absen2, orde(2));
% Orde 4, epsilon = 1
[n result13] = Runge_Kutta( x, h, y0, y_absen, orde(2));
[n result14] = Runge_Kutta( x, h, y0, z_absen3, orde(2));
% Orde 4, epsilon = 10
[n result15] = Runge_Kutta( x, h, y0, y_absen, orde(2));
[n result16] = Runge_Kutta( x, h, y0, z_absen4, orde(2));

result = [result1(1) result2(2) result3(1) result4(2) result5(1) result6(2) result7(1) result8(2) result9(1) result10(2) result11(1) result12(2) result13(1) result14(2) result15(1) result16(2)];

clear result1 result2 result3 result4 result5 result6 result7 result8;
clear result9 result10 result11 result12 result13 result14 result15 result16;

%------------------------------------------------%
% Pembuatan report
%------------------------------------------------%
% Soal
soal1 = 'y'''' + x = 0.01*x^2'; % nanti epsilonnya bisa diganti2..
numsoal = 1;
% Variabel
x0 = x(1); xn = x(2);
% h = h (variabel dan globalnya sama)
% n = n (variabel dan globalnya sama)
y01 = y0(1); y02 = y0(2);
numy0 = 2;
% Fungsi untuk perhitungan
fungsi1 = func2str(y_absen);
fungsi2 = func2str(z_absen1);
numfungsi = 2;
% Metode
metodestring = 'Runge-Kutta Orde 3';
% Hasil
hasil1 = result(1);
hasil2 = result(2);
numhasil = 2;
% Generate Report
report('DifferentialEquation');
